home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample SMSAM / SampleSMSAM Source / BuildingBlocks / EventCountdown.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-28  |  1.3 KB  |  57 lines  |  [TEXT/R*ch]

  1.  /*
  2.     File:        EventCountdown.h
  3.  
  4.     Copyright:    © 1991-1994 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Part of the AOCE Sample SMSAM Package.  Consult the license
  8.     which came with this software for your specific legal rights.
  9.  
  10. */
  11.  
  12.  
  13.  
  14. #pragma once
  15.  
  16. #ifndef __EVENTCOUNTDOWN__
  17. #define    __EVENTCOUNTDOWN__ 1
  18.  
  19. #ifndef __DIRECTOBJECT__
  20. #include "DirectObject.h"
  21. #endif
  22.  
  23. /***********************************|****************************************/
  24.  
  25. class TEventCountdown : public TDirectObject
  26. {
  27. public:                                TEventCountdown ( );
  28.                                     TEventCountdown ( unsigned long defaultInterval );
  29.     virtual                            ~TEventCountdown ( );
  30.     
  31.     virtual Boolean                    ExpiredYet ( ) const;
  32.  
  33.     virtual Boolean                    ResetTimer ( );
  34.     virtual Boolean                    ResetTimer ( unsigned long interval );
  35.  
  36.     virtual unsigned long            ExpirationCount ( ) const;
  37.     
  38.     virtual Boolean                    SetExpiration ( unsigned long expireAtThisTime );
  39.     
  40.     virtual ostream&                operator << ( ostream& s );
  41.  
  42. protected:
  43.     unsigned long                    fDefaultInterval;
  44.     unsigned long                    fExpirationAt;
  45.     unsigned long                    fExpirationCount;
  46. };
  47.  
  48. /***********************************|****************************************/
  49.  
  50. const unsigned long kOneMinuteInSeconds = 60;
  51. const unsigned long kOneHourInSeconds = 3600;
  52. const unsigned long kOneDayInSeconds = 3600 * 24;
  53.  
  54. /***********************************|****************************************/
  55.  
  56. #endif
  57.